/*
 * @Date         : 2022-07-08 21:28:23
 * @LastEditors  : zu1662
 * @LastEditTime : 2022-07-10 12:03:31
 * @Description  : 邮件发送 Entity
 * 
 * Copyright © 2022 by zu1662, All Rights Reserved. 
 */
import { ApiProperty } from '@nestjs/swagger';
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity({ name: 'smtp' })
export class SMTPEntity {
  @ApiProperty()
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @ApiProperty()
  @Column({ default: null })
  from: string; // 发件人

  @ApiProperty()
  @Column({ default: null })
  to: string; // 收件人

  @ApiProperty()
  @Column({ charset: 'utf8mb4', default: null })
  subject: string; // 主题

  @ApiProperty()
  @Column({ charset: 'utf8mb4', type: 'text', default: null })
  text: string; // 文本内容

  @ApiProperty()
  @Column({ charset: 'utf8mb4', type: 'text', default: null })
  html?: string; // html内容

  @ApiProperty()
  @CreateDateColumn({
    type: 'datetime',
    comment: '创建时间',
    name: 'create_at',
  })
  createAt: Date;
}
